<template>
  <div class="staff">
    <div class="staff_header">
      <el-input
        v-model="input"
        placeholder="输入员工名称/手机号"
        style="width: 300px"
      ></el-input>
      <div>
        <span class="department">部门</span>
        <el-select v-model="value" placeholder="选择部门">
          <el-option
            v-for="item in options"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option>
        </el-select>
      </div>
      <div class="staff_header_btn">
        <el-button round size="medium ">查询</el-button>
        <el-button round @click="handleAddUser">新增</el-button>
      </div>
    </div>

    <div class="staff_content">
      <el-table
        ref="multipleTable"
        :data="tableData"
        tooltip-effect="dark"
        style="width: 100%"
        @selection-change="handleSelectionChange"
      >
        <el-table-column type="selection" width="55"> </el-table-column>
        <el-table-column label="用户名称" width="120">
          <template slot-scope="scope">{{ scope.row.date }}</template>
        </el-table-column>
        <el-table-column prop="name" label="用户类型" width="120">
        </el-table-column>
        <el-table-column prop="address" label="手机号" show-overflow-tooltip>
        </el-table-column>
        <el-table-column prop="address" label="所属医院" show-overflow-tooltip>
        </el-table-column>
        <el-table-column prop="address" label="所属企业" show-overflow-tooltip>
        </el-table-column>
        <el-table-column prop="address" label="部门职位" show-overflow-tooltip>
        </el-table-column>
        <el-table-column prop="address" label="注册时间" show-overflow-tooltip>
        </el-table-column>
        <el-table-column prop="address" label="状态" show-overflow-tooltip>
        </el-table-column>
        <el-table-column prop="address" label="操作" show-overflow-tooltip>
          <span>启用</span>
          <span>编辑</span>
          <span>删除</span>
        </el-table-column>
      </el-table>

      <!-- 分页 -->
      <!-- <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="currentPage4"
      :page-sizes="[100, 200, 300, 400]"
      :page-size="100"
      layout="total, sizes, prev, pager, next, jumper"
      :total="400">
    </el-pagination> -->
    </div>

    <el-dialog title="收货地址" :visible.sync="dialogAddUser">
      <el-form :model="form">
        <el-form-item label="活动名称" :label-width="formLabelWidth">
          <el-input v-model="form.name"></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogAddUser = false">取 消</el-button>
        <el-button type="primary" @click="dialogAddUser = false"
          >确 定</el-button
        >
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      form: {
        name: "",
        region: "",
        date1: "",
        date2: "",
        delivery: false,
        type: [],
        resource: "",
        desc: "",
      },
      dialogAddUser: false,
      tableData: [
        {
          date: "2016-05-03",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
      ],
      multipleSelection: [],
    };
  },
  methods: {
    toggleSelection(rows) {
      if (rows) {
        rows.forEach((row) => {
          this.$refs.multipleTable.toggleRowSelection(row);
        });
      } else {
        this.$refs.multipleTable.clearSelection();
      }
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    handleAddUser() {
      console.log(12);
      this.dialogAddUser = true;
    },
  },
};
</script>

<style lang="scss" scoped>
$myColor: #d7152d;

.staff {
  .staff_header {
    width: 100%;
    display: flex;
    padding: 20px 10px;
    box-sizing: border-box;
    background: #fff;

    .department {
      margin: 0 20px;
    }

    .staff_header_btn {
      flex: 1;
      display: flex;
      justify-content: space-between;
      padding: 0 30px;

      .el-button {
        color: #fff;
        background: $myColor;
      }
    }
  }

  .staff_content {
    margin-top: 20px;
    padding: 20px 10px;
    box-sizing: border-box;
    background: #fff;
  }
}
</style>